import request from '@/utils/request'

// 获取组织架构
export function getStructure() {
  return request({
    url: '/admin/getstructure',
    method: 'get'
  })
}

// 删除分支
export function delStructure(id) {
  return request({
    url: `/admin/deletestructure?id=${id}`,
    method: 'delete'
  })
}

// 添加分支
export function addStructure(data) {
  return request({
    url: `/admin/addstructure`,
    method: 'post',
    data
  })
}

// 编辑分支
export function editStructure(id, data) {
  return request({
    url: `/admin/editstructure?id=${id}`,
    method: 'put',
    data
  })
}
